{layout name="public/layout" /}
{include file='yxnavbar'}


<div class="main">
    {include file='koi_common_nav'}
    <div class="panel panel-info">
        <div class="panel-heading">当前数量： {$page_total}</div>
        <div class="panel-body">
            <form id = "myform" action="./index.php" method="get" class="form-horizontal" role="form">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="{$_P['m']}" />
                <input type="hidden" name="do" value="{$do}" />
                <input type="hidden" name="op" value="chance_search" />
                <input type="hidden" name="type" value="{$ac}" />
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">手机号、微信昵称</label>
                    <div class="col-sm-9 col-xs-9 col-md-9">
                        <input class="form-control" name="search_data" placeholder="输入报名手机号或微信昵称" type="text" value="{$_P['search_data']}">
                    </div>
                </div>
                <div class="form-group clearfix">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">浏览时间</label>
                    <div class="col-sm-3 col-lg-3 col-md-3 col-xs-6">
                        {php echo view_form_field_daterange('createtime', array('start' => $start_day, 'end' => $end_day));}
                    </div>
                    <div class="col-sm-3 col-lg-3 col-md-3 col-xs-6">
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                        <input type="hidden" name="__token__" value="{$Request.token}"/>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <input type="hidden" name="current_ac" id="current_ac" value="{$ac}">
    <!--  列表框  -->
    <div class="tab-content">
        <div class="panel panel-default">
            <div class="panel-body table-responsive">
                <table class="table table-hover">
                    <thead class="navbar-inner">
                    <tr>
                        <th style="width: 50px">序号</th>
                        <th style="width: 120px">用户昵称</th>
                        <th style="width: 120px">用户报名信息</th>
                        <th style="width: 100px">用户头像</th>
                        <th style="width: 100px">机会来源</th>
                        <th style="width: 100px">操作次数</th>
                        <th style="width: 100px">更新时间</th>
<!--                        <th style="width: 120px">操作</th>-->
                    </tr>
                    </thead>
                    <tbody>
                    {loop $list $item}
                    <tr>
                        <td>{$item['c_id']}</td>
                        <td>{$item['nickname']}</td>
                        <td>{$item['username']}<br/>{$item['mobile']}</td>
                        <td>
                            <a href="{php echo tomedia($item['avatar']);}"  target="_blank" title="查看原图">
                                <img src="{php echo tomedia($item['avatar']);}" style="width: 40px;height: 40px;padding: 1px;">
                            </a>
                        </td>
                        <td>
                            {if $item['type']=='system'}
                            <span class="label label-warning">{php echo formatKoiChanceFrom($item['type']);}</span>
                            {else}
                            <span class="label label-success">{php echo formatKoiChanceFrom($item['type']);}</span>
                            {/if}
                        </td>
                        <td>
                            {if $item['type']=='system'}
                                {$item['chance']}
                            {else}
                                +{$item['chance']}
                            {/if}
                        </td>
                        <td>
                            {$item['updated_at']}
                        </td>
<!--                        <td>-->
<!--                            <a class="btn btn-primary btn-sm" style="width: 35px" onclick="changeOrDelLttInfo(this)" data-type="edit" data-edit-url="{php echo createWebUrl('koi', array('op' =>'prize_edit','themeid'=>$themeid,'p_id'=>$item['p_id']));}" data-themeid="{$themeid}" data-id="{$item['p_id']}"  title="修改信息" data-toggle="tooltip" data-placement="top"><i class="fa fa-pencil-square-o"> </i></a>-->

<!--                        </td>-->
                    </tr>
                    {/loop}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{$pager}
<script type="text/javascript">
    $(document).ready(
        function (){
        }
    );
    function drop_confirm(msg, url){
        if(confirm(msg)){
            window.location = url;
        }
    }
    // 修改、删除
    function changeOrDelLttInfo(e) {
        let p_id = e.getAttribute("data-id");
        let type = e.getAttribute("data-type");
        let themeid = e.getAttribute("data-themeid");
        let redirectUrl = e.getAttribute("data-edit-url");
        let postUrl ="";
        if (type=='edit'){
            window.location.href = redirectUrl;
        }
    }
</script>
